<template>
  <div>
    <h2>{{ this.$route.params.id }}</h2>
    <button @click="back()">返回</button>
    <h4>实现方式</h4>
    (1)注册路由----{ path:'/b/:id', name: 'B', component: B }
    <br />
    (2)绑定事件和要传的值以及路由地址---- this.$router.push({ path:
    `/b/${this.bbb}` })
    <br/>
    (3)在B组件中获取传递的参数----this.$route.params.id
  </div>
</template>

<script>
export default {
  name: 'A',
  methods: {
    back() {
      this.$router.push('/use-router')
    }
  }
}
</script>

<style scoped></style>
